package usually;
//11. 盛最多水的容器
public class Num11_maxArea {
    public int maxArea(int[] height) {

        int i = 0;
        int j = height.length-1;
        int res = 0;
        while (i < j){
            res = height[i] < height[j] ?//双指针，移动短板才有可能让面积增大
                    Math.max(res,(j - i) * height[i++]):
                    Math.max(res,(j - i) * height[j--]);

        }
        return res;

    }
}
